<template>
  <div class="bgys">
    <!-- 头部标题 -->
    <HeadMain :audioUrl="audioUrl" @bfwc="bfwc" />
    <!-- 任务栏 -->
    <div class="tool taskclosebox" @click="closefn" v-if="!erstepshow">
      <img src="@/images/taskclose.png" alt="" class="normal" />
      <img src="@/images/taskcloseac.png" alt="" class="active" />
    </div>
    <div class="taskbox beautifulScroll">
      <!-- 一级菜单 -->
      <div
        class="tool taskboxitem"
        v-for="item in taskdata"
        :key="item.id"
        @click="taskfn(item.id)"
        v-show="item.id == erstep || erstepshow"
      >
        <img
          src="@/images/taska.png"
          alt=""
          class="normal bgm"
          v-if="taskstep != item.id"
        />
        <img
          src="@/images/taskac.png"
          alt=""
          class="active bgm"
          v-if="taskstep != item.id"
        />
        <img
          src="@/images/taskac.png"
          alt=""
          v-if="taskstep == item.id"
          class="bgm"
        />
        <!-- 序号 -->
        <span class="taskitemid">{{ item.id }}</span>
        <!-- 名字 -->
        <span class="taskitemname">{{ item.name }}</span>
      </div>
      <!-- 二级菜单 -->
      <div class="erbox" v-if="!erstepshow">
        <div v-for="items in taskdata[erstep - 1].erdata" :key="items.id">
          <div
            :class="eritem == items.id ? 'erboxitem erboxitemac ' : 'erboxitem'"
            @click="erjifn(items.id)"
          >
            <span>{{ items.name }}</span>
          </div>
          <!--  三级菜单 变态反人类设计 当点击的二级菜单 = 三级菜单的时候才让他显示-->
          <div class="sjbox" v-if="eritem == items.id && sjbox">
            <div
              :class="itemsd.id == sjstep ? 'sjitemac sjitem' : 'sjitem'"
              v-for="itemsd in items.sandata"
              :key="itemsd.id"
              @click="sjstep = itemsd.id"
            >
              <span>{{ itemsd.name }}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 准备步骤物品穿戴 -->
    <wp-tool
      v-if="taskstep == 1"
      :eritem="eritem"
      @tg="tg"
      @eritemfn="eritemfn"
    />
    <!-- 静脉采血步骤 -->
    <jmcx-bz
      ref="jmcxbz"
      @eritemfn="eritemfn"
      :eritem="eritem"
      v-if="taskstep == 2"
      @audioUrlfn="audioUrlfn"
      @taskfn="taskfn"
    />
    <!-- 酶免分析步骤 -->
    <m-mfx
      ref="mfx"
      v-if="taskstep == 5"
      @eritemfn="eritemfn"
      :eritem="eritem"
      @taskfn="taskfn"
      :sjstep="sjstep"
      :sjname="sjname"
      @sjstepfn="sjstepfn"
    />

    <!-- 场景文件 -->
    <seen
      :eritem="eritem"
      :eritems="eritems"
      :sjstep="sjstep"
      :taskstep="taskstep"
      ref="seen"
      @clickItem="clickItem"
      @tipstextfn="tipstextfn"
    />
    <!-- 步骤提示 -->
    <bz-tip :bztext="bztext" v-if="bztext" />
    <!-- 文字提示 -->
    <right-tips :tipstext="tipstext" v-if="tipstext" />
    <!-- 警示文字 -->
    <error-tips :errortext="errortext" v-if="errortext" />
    <!-- 操作面板UI -->
    <div class="szuibox" v-if="szuiboxshow">
      <img src="@/images/czuibo.png" alt="" class="czuibo" />
      <div class="tool sjia" @click="sjia">
        <i class="el-icon-plus sjiaiocn"></i>
        <img src="@/images/jiad.png" alt="" class="normal" />
        <img src="@/images/jiadac.png" alt="" class="active" />
      </div>
      <div class="tool sjias" @click="sjias">
        <i class="el-icon-plus sjiaiocn"></i>
        <img src="@/images/jiad.png" alt="" class="normal" />
        <img src="@/images/jiadac.png" alt="" class="active" />
      </div>
      <div class="tool sjiaa" @click="sjiaa">
        <i class="el-icon-minus sjiaiocn"></i>
        <img src="@/images/jiad.png" alt="" class="normal" />
        <img src="@/images/jiadac.png" alt="" class="active" />
      </div>
      <div class="tool sjiaas" @click="sjiaas">
        <i class="el-icon-minus sjiaiocn"></i>
        <img src="@/images/jiad.png" alt="" class="normal" />
        <img src="@/images/jiadac.png" alt="" class="active" />
      </div>
      <div class="szuir">{{ szuir }}</div>
      <div class="szuit">{{ szuit }}</div>
    </div>
    <!-- 签字 -->
    <div
      class="qzbox"
      v-if="eritems == 6.1 || eritems == 6.2 || eritems == 6.3"
    >
      <img src="@/images/wqbgd.png" alt="" v-if="eritems == 6.1" />
      <img src="@/images/bgd.png" alt="" v-if="eritems == 6.2" />
      <div class="qzanbox">
        <div v-if="eritems == 6.1" @click="eritems = 6.2">签字</div>
        <div v-if="eritems == 6.2" @click="eritems = 6.3">审核通过</div>
      </div>
    </div>
  </div>
</template>

<script>
import { mixins } from '@/mixin/index'
import HeadMain from '@/components/headMain.vue'
import WpTool from '@/components/wpTool.vue'
import JmcxBz from '@/components/jmcxBz.vue'
import MMfx from '@/components/mMfx.vue'
import Seen from './seen.vue'
import BzTip from '@/components/bzTip.vue'
import RightTips from '@/components/rightTips.vue'
import ErrorTips from '@/components/errorTips.vue'
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  mixins: [mixins],
  //import引入的组件需要注入到对象中才能使用
  components: {
    HeadMain,
    WpTool,
    JmcxBz,
    MMfx,
    BzTip,
    RightTips,
    ErrorTips,
    Seen
  },
  data() {
    //这里存放数据
    return {
      szuiboxshow: false,
      szuir: 0,
      szuit: 0,
      audioUrl: '',
      taskstep: 1, //当前所在一级分类
      taskdata: [
        {
          id: 1,
          name: '准备',
          erdata: [
            {
              id: 1,
              name: '穿工作服'
            },
            {
              id: 2,
              name: '洗手'
            },
            {
              id: 3,
              name: '戴口罩'
            },
            {
              id: 4,
              name: '戴手套'
            }
          ]
        },
        {
          id: 2,
          name: '静脉采血',
          erdata: [
            {
              id: 1,
              name: '采血前准备'
            },
            {
              id: 2,
              name: '核对患者信息'
            },
            {
              id: 3,
              name: '绑扎压脉带'
            },
            {
              id: 4,
              name: '采血点消毒'
            },
            {
              id: 5,
              name: '采血'
            },
            {
              id: 6,
              name: '拔针按压'
            },
            {
              id: 7,
              name: '标本处理'
            }
          ]
        },
        {
          id: 3,
          name: '样品离心',
          erdata: [
            {
              id: 1,
              name: '开机'
            },
            {
              id: 2,
              name: '放入样品'
            },
            {
              id: 3,
              name: '放入平衡试管'
            },
            {
              id: 4,
              name: '设置参数'
            },
            {
              id: 5,
              name: '开始样品离心'
            },
            {
              id: 6,
              name: '取出样品'
            },
            {
              id: 7,
              name: '检查样品'
            }
          ]
        },
        {
          id: 4,
          name: '样品开盖',
          erdata: [
            {
              id: 1,
              name: '放入样品'
            },
            {
              id: 2,
              name: '开盖'
            }
          ]
        },
        {
          id: 5,
          name: '酶免分析',
          erdata: [
            {
              id: 1,
              name: '学习实验方法'
            },
            {
              id: 2,
              name: '检查酶免仪器',
              sandata: [
                {
                  id: 1,
                  name: '检查电源开关'
                },
                {
                  id: 2,
                  name: '检查维护液'
                },
                {
                  id: 3,
                  name: '检查蒸馏水'
                },
                {
                  id: 4,
                  name: '检查清洗液'
                },
                {
                  id: 5,
                  name: '检查乙醚'
                }
              ]
            },
            {
              id: 3,
              name: '启动酶免仪'
            },
            {
              id: 4,
              name: '设置工作站',
              sandata: [
                {
                  id: 1,
                  name: '登录工作站'
                },
                {
                  id: 2,
                  name: '开机维护'
                },
                {
                  id: 3,
                  name: '开始试验'
                }
              ]
            },
            {
              id: 5,
              name: '检查试剂',
              sandata: [
                {
                  id: 1,
                  name: '摆放血液样本'
                },
                {
                  id: 2,
                  name: '检查HBsAg稀释液'
                },
                {
                  id: 3,
                  name: '检查HBsAG酶'
                },
                {
                  id: 4,
                  name: '检查A液'
                },
                {
                  id: 5,
                  name: '检查B液'
                },
                {
                  id: 6,
                  name: '检查终止液'
                }
              ]
            },
            {
              id: 6,
              name: '开始运行',
              sandata: [
                {
                  id: 1,
                  name: '调试运行图'
                },
                {
                  id: 2,
                  name: '开始执行'
                },
                {
                  id: 3,
                  name: '查看实验结果'
                },
                {
                  id: 4,
                  name: '直接读数'
                },
                {
                  id: 5,
                  name: '打印报告单'
                }
              ]
            },
            {
              id: 7,
              name: '仪器关机',
              sandata: [
                {
                  id: 1,
                  name: '关闭工作站'
                },
                {
                  id: 2,
                  name: '关闭计算机'
                },
                {
                  id: 3,
                  name: '关闭酶免仪'
                }
              ]
            },
            {
              id: 8,
              name: '实验结束'
            }
          ]
        }
      ],
      erstep: 1, // 在二级菜单 第一个展示当前所在的一级菜单名
      erstepshow: false, //二级菜单开启标识2
      eritem: 1, //当前所在二级步骤
      sjstep: 1,
      sjname: '',
      sjbox: false,
      bztext: '',
      tipstext: '',
      errortext: '',
      eritems: 0
    }
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {
    sjstep: {
      handler(i) {
        if (i == 1) {
          this.sjbox = true
          this.eritems = this.eritem
        }
        // if (ol == 1) {
        //   this.sjbox = true
        // }
        if (i == 2 && this.eritem == 4 && this.taskstep == 5) {
          this.eritems = 4.2
        }
        console.log(
          '当前三级菜单检测到数据变化',
          this.sjstep,
          '三级小标识',
          this.eritems,
          'task',
          this.taskstep
        )

        if (i == 2 && this.taskstep == 5 && this.eritem == 2) {
          this.$refs.seen.twinklePoint(-1.85, 0.69, -3.805)
          this.$refs.seen.move(
            [-1.803, 0.874, -2.454],
            [-15.78 / 180, -1.54 / 180, -0.43 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '点击检查维护液是否充足'
          this.eritems = 2.2
        }
        if (i == 3 && this.taskstep == 5 && this.eritem == 2) {
          this.$refs.seen.twinklePoint(-0.914, 0.708, -3.865)
          this.$refs.seen.move(
            [-0.662, 0.864, -2.862],
            [-21.23 / 180, -1.22 / 180, -0.48 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '点击检查蒸馏水是否充足'
          this.eritems = 2.3
        }
        if (i == 4 && this.taskstep == 5 && this.eritem == 2) {
          this.$refs.seen.twinklePoint(-0.676, 0.602, -4.666)
          this.$refs.seen.move(
            [-0.2, 0.484, -4.06],
            [-13.23 / 180, 36.14 / 180, 7.93 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '点击检查清洗液是否充足'
          this.eritems = 2.4
        }
        if (i == 5 && this.taskstep == 5 && this.eritem == 2) {
          this.$refs.seen.twinklePoint(-0.659, 0.678, -3.848)
          this.$refs.seen.move(
            [-0.662, 0.864, -2.862],
            [-21.23 / 180, -1.22 / 180, -0.48 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '点击检查乙醚是否充足'
          this.eritems = 2.5
        }
        if (i == 1 && this.taskstep == 5 && this.eritem == 5) {
          this.$refs.seen.initFileS(2)
          this.$refs.seen.twinklePoint(0.858, 0.959, -4.532)
          this.$refs.seen.move(
            [0.925, 1.245, -3.788],
            [-35.1 / 180, 0.51 / 180, 0.36 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '点击“样本架1”，将患者血液放置样本架1对应位置。'
          this.eritems = 5.1
        }
        if (i == 2 && this.taskstep == 5 && this.eritem == 5) {
          this.$refs.seen.twinklePoint(-1.625, 1.086, -4.508)
          this.$refs.seen.move(
            [-1.53, 1.412, -3.742],
            [-43.88 / 180, 7.51 / 180, 7.16 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext =
            '在试剂架4中找到HBsAg稀释液，点击检查HBsAg稀释液是否充足'
          this.eritems = 5.2
        }
        if (i == 3 && this.taskstep == 5 && this.eritems == 5.2) {
          this.$refs.seen.twinklePoint(-1.717, 1.082, -4.462)
          this.$refs.seen.move(
            [-1.44, 1.437, -3.756],
            [-46.18 / 180, 14.64 / 180, 14.75 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '在试剂架1中找到HBsAg酶，点击检查HBsAg酶是否充足'
          this.eritems = 5.3
        }
        if (i == 4 && this.taskstep == 5 && this.eritems == 5.3) {
          this.$refs.seen.twinklePoint(-1.537, 1.169, -4.387)
          this.$refs.seen.move(
            [-1.905, 1.268, -3.924],
            [-30.24 / 180, -40.84 / 180, -20.87 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '在试剂架8中找到A液，点击检查A液是否充足'
          this.eritems = 5.4
        }
        if (i == 5 && this.taskstep == 5 && this.eritems == 5.4) {
          this.$refs.seen.twinklePoint(-1.488, 1.131, -4.316)
          this.$refs.seen.move(
            [-1.905, 1.268, -3.924],
            [-30.24 / 180, -40.84 / 180, -20.87 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '在试剂架8中找到B液，点击检查B液是否充足'
          this.eritems = 5.5
        }
        if (i == 6 && this.taskstep == 5 && this.eritems == 5.5) {
          this.$refs.seen.twinklePoint(-1.413, 1.108, -4.231)
          this.$refs.seen.move(
            [-1.905, 1.268, -3.924],
            [-30.24 / 180, -40.84 / 180, -20.87 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '在试剂架8中找到终止液，点击检查终止液是否充足'
          this.eritems = 5.6
        }
        if (i == 5 && this.eritems == 6) {
          console.log('触发了')
          this.$refs.seen.initFileS(2)
          this.$refs.seen.twinklePoint(1.517, 1.526, -4.775)
          this.$refs.seen.move(
            [1.693, 1.648, -2.202],
            [-6.69 / 180, 0.37 / 180, 0.04 / 180]
          )
          this.bztext = '点击电脑开始审核报告单，确认无误后签字'
          // this.eritems = 6.1
        }
        if (i == 1 && this.eritems == 7) {
          this.bztext = '点击打印机，打印报告单'
        }
        if (i == 2 && this.eritem == 7) {
          this.$refs.seen.initFileS(2)
          this.$refs.seen.twinklePoint(2.149, 0.218, -3.828)
          this.$refs.seen.move(
            [2.142, 0.358, -3.032],
            [-4.68 / 180, 0 / 180, -0.02 / 180]
          )
          this.bztext = '点击电脑电源键，关闭电脑'
          this.eritems = 7.1
        }
        if (i == 3 && this.eritem == 7) {
          // this.$refs.seen.initFileS(2)
          this.$refs.seen.twinklePoint(-2.456, 1.455, -3.642)
          this.$refs.seen.move(
            [-2.463, 1.422, -2.542],
            [0.71 / 180, -1.39 / 180, 0.02 / 180]
          )
          this.bztext = '点击酶免仪电源键，关闭酶免仪'
          this.eritems = 7.2
        }
      },
      immediate: true,
      deep: true
    },
    sjbox: {
      handler(i) {
        console.log('当前三级菜单状态', i)
      },
      immediate: true,
      deep: true
    },
    taskstep: {
      handler(i) {
        this.sjbox = false
        // console.log('cs', i)
        this.eritem = 1
        if (this.eritem == 1 && i == 3) {
          this.$refs.seen.initFileS(0)
          this.$refs.seen.twinklePoint(15.522, 1.211, -2.6)
          this.$refs.seen.move(
            [14.192, 2.092, -2.688],
            [-89.45 / 180, -58.44 / 180, -89.35 / 180]
          )
          this.bztext = '点击打开离心机电源'
        }
        if (this.eritem == 1 && i == 4) {
          this.$refs.seen.initFileS(0)
          this.$refs.seen.twinklePoint(15.466, 1.213, -3.625)
          this.$refs.seen.move(
            [14.169, 1.818, -3.955],
            [-90.0 / 180, -66.79 / 180, -90.0 / 180]
          )
          this.bztext = '点击离心后的样品，将其放至开盖机进样口'
        }
        if (this.eritem == 1 && i == 5 && this.sjstep == 1) {
          this.$refs.seen.initFileS(2)
          this.$refs.seen.twinklePoint(15.466, 1.213, -3.625)
          this.$refs.seen.move(
            [-6.261, 1.8, -4.48],
            [-108.46 / 180, -86.39 / 180, -108.49 / 180]
          )
          // this.bztext = '点击离心后的样品，将其放至开盖机进样口'
        }
      }
    },
    eritem: {
      handler(i) {
        this.sjname = this.taskdata[this.taskstep - 1].erdata[i - 1].name
        this.szuiboxshow = false
        this.sjstep = 1
        this.sjbox = true
        this.eritems = i
        this.bztext = ''

        if (i == 1 && this.taskstep == 3) {
          this.$refs.seen.twinklePoint(15.522, 1.211, -2.6)
          this.$refs.seen.move(
            [14.192, 2.092, -2.688],
            [-89.45 / 180, -58.44 / 180, -89.35 / 180]
          )
          this.$refs.seen.initFileS(0)
          this.bztext = '点击打开离心机电源'
        }
        if (i == 2 && this.taskstep == 3) {
          this.$refs.seen.twinklePoint(15.522, 1.211, -2.6)
          this.$refs.seen.move(
            [14.192, 2.092, -2.688],
            [-89.45 / 180, -58.44 / 180, -89.35 / 180]
          )
          this.$refs.seen.initFileS(0)
          this.bztext = '点击“开门”按钮，打开离心机机盖'
        }
        if (i == 3 && this.taskstep == 3) {
          this.$refs.seen.twinklePoint(15.529, 1.219, -1.719)
          this.$refs.seen.move(
            [14.125, 2.181, -2.372],
            [-89.73 / 180, -59.87 / 180, -89.69 / 180]
          )
          this.$refs.seen.initFileS(0)
          this.bztext = '点击平衡管，将其放入离心机中'
        }
        if (i == 4 && this.taskstep == 3) {
          this.$refs.seen.twinklePoint(15.593, 1.196, -2.612)
          this.$refs.seen.move(
            [15.042, 1.318, -2.688],
            [-89.61 / 180, -67.9 / 180, -89.58 / 180]
          )
          this.$refs.seen.initFileS(0)
          this.bztext = '点击离心机操作面板，设置参数'
        }
        if (i == 5 && this.taskstep == 3) {
          this.$refs.seen.twinklePoint(15.593, 1.196, -2.612)
          this.$refs.seen.move(
            [15.042, 1.318, -2.688],
            [-89.61 / 180, -67.9 / 180, -89.58 / 180]
          )
          this.$refs.seen.initFileS(0)
          this.bztext = '点击“启动”按钮，开始样品离心'
        }
        if (i == 6 && this.taskstep == 3) {
          this.$refs.seen.twinklePoint(15.593, 1.196, -2.612)
          this.$refs.seen.move(
            [15.042, 1.318, -2.688],
            [-89.61 / 180, -67.9 / 180, -89.58 / 180]
          )
          this.$refs.seen.initFileS(0)
          this.bztext = '点击“开门”按钮，打开离心机机盖'
        }
        if (i == 7 && this.taskstep == 3) {
          this.$refs.seen.initFileS(0)
          this.bztext =
            '点击离心后的样品，检查血量是否充足，是否溶血，避免出现凝块'
          this.$refs.seen.twinklePoint(15.466, 1.213, -3.625)
          this.$refs.seen.move(
            [13.837, 1.361, -3.565],
            [-90 / 180, -92.33 / 180, -90 / 180]
          )
        }
        if (i == 1 && this.taskstep == 4) {
          this.$refs.seen.initFileS(0)
          this.$refs.seen.twinklePoint(15.466, 1.213, -3.625)
          this.$refs.seen.move(
            [14.169, 1.818, -3.955],
            [-90.0 / 180, -66.79 / 180, -90.0 / 180]
          )
          this.bztext = '点击离心后的样品，将其放至开盖机进样口'
        }
        if (i == 2 && this.taskstep == 4) {
          this.$refs.seen.twinklePoint(15.406, 1.583, -4.36)
          this.$refs.seen.move(
            [14.482, 2.014, -4.463],
            [-90.0 / 180, -55.29 / 180, -90.0 / 180]
          )
          this.bztext = '点击开始按钮，开始开盖'
          this.$refs.seen.initFileS(0)
        }

        if (i == 2 && this.taskstep == 5 && this.sjstep == 1) {
          this.$refs.seen.initFileS(2)
          this.$refs.seen.twinklePoint(-2.404, 0.754, -4.815)
          this.$refs.seen.move(
            [-3.625, 0.87, -4.378],
            [-84.34 / 180, -71.55 / 180, -84.04 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '点击检查酶免仪开关是否合上'
        }
        if (i == 3 && this.taskstep == 5) {
          this.$refs.seen.initFileS(2)
          this.$refs.seen.twinklePoint(-2.456, 1.455, -3.642)
          this.$refs.seen.move(
            [-2.463, 1.422, -2.542],
            [0.71 / 180, -1.39 / 180, 0.02 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '点击电源键，启动酶免仪'
        }
        if (i == 5 && this.taskstep == 5 && this.sjstep == 1) {
          this.$refs.seen.initFileS(2)
          this.$refs.seen.twinklePoint(0.858, 0.959, -4.532)
          this.$refs.seen.move(
            [0.925, 1.245, -3.788],
            [-35.1 / 180, 0.51 / 180, 0.36 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '点击“样本架1”，将患者血液放置样本架1对应位置。'
          this.eritems = 5.1
        }
        if (i == 5 && this.taskstep == 5 && this.sjstep == 2) {
          this.$refs.seen.initFileS(2)
          this.$refs.seen.twinklePoint(-1.625, 1.086, -4.508)
          this.$refs.seen.move(
            [-1.53, 1.412, -3.742],
            [-43.88 / 180, 7.51 / 180, 7.16 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext =
            '在试剂架4中找到HBsAg稀释液，点击检查HBsAg稀释液是否充足'
          this.eritems = 5.2
        }
      },
      immediate: true,
      deep: true
    },
    eritems: {
      handler(i) {
        if (i == 8) {
          this.$router.push({
            name: 'wcsy'
          })
        }
        console.log('当前父组件eritems的值', i)
        this.tipstext = ''
        clearTimeout(this.timer)
        if (i == 2.1 && this.taskstep == 3) {
          this.$refs.seen.twinklePoint(15.533, 1.227, -1.758)
          this.$refs.seen.move(
            [14.125, 2.181, -2.372],
            [-89.73 / 180, -59.87 / 180, -89.69 / 180]
          )
          this.bztext = '点击待离心样品，将其放入离心机中'
        }
        if (i == 3.1 && this.taskstep == 3) {
          this.$refs.seen.twinklePoint(15.855, 1.867, -2.686)
          this.$refs.seen.move(
            [14.125, 2.181, -2.372],
            [-89.73 / 180, -59.87 / 180, -89.69 / 180]
          )
          this.bztext = '点击盖上离心机机盖'
        }
        if (i == 5.1 && this.taskstep == 3) {
          this.tipstext = '样品离心完成'
          this.timer = setTimeout(() => {
            this.tipstext = ''
            this.eritem = 6
            clearTimeout(this.timer)
          }, 1000)
        }
        if (i == 6.1 && this.taskstep == 3) {
          this.bztext = '点击取出离心完成后的样品'
          this.$refs.seen.twinklePoint(15.758, 1.454, -2.796)
          this.$refs.seen.move(
            [15.023, 2.219, -2.728],
            [-90 / 180, -41.98 / 180, -90 / 180]
          )
        }
        if (i == 6.2 && this.taskstep == 3) {
          this.bztext = '点击盖上离心机机盖'
          this.$refs.seen.twinklePoint(15.855, 1.867, -2.686)
          this.$refs.seen.move(
            [14.125, 2.181, -2.372],
            [-89.73 / 180, -59.87 / 180, -89.69 / 180]
          )
        }
        if (i == 6.3 && this.taskstep == 3) {
          this.bztext = '点击关闭离心机电源'
          this.$refs.seen.twinklePoint(15.522, 1.211, -2.6)
          this.$refs.seen.move(
            [14.192, 2.092, -2.688],
            [-89.45 / 180, -58.44 / 180, -89.35 / 180]
          )
        }

        if (i == 2 && this.taskstep == 5 && this.sjstep == 1) {
          this.$refs.seen.initFileS(2)
          this.$refs.seen.twinklePoint(-2.404, 0.754, -4.815)
          this.$refs.seen.move(
            [-3.625, 0.87, -4.378],
            [-84.34 / 180, -71.55 / 180, -84.04 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '点击检查酶免仪开关是否合上'
        }

        if (i == 2.2 && this.taskstep == 5 && this.sjstep == 2) {
          this.$refs.seen.twinklePoint(-1.85, 0.69, -3.805)
          this.$refs.seen.move(
            [-1.803, 0.874, -2.454],
            [-15.78 / 180, -1.54 / 180, -0.43 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '点击检查维护液是否充足'
        }
        if (i == 3.1 && this.taskstep == 5) {
          this.$refs.seen.twinklePoint(-1.211, 1.409, -3.563)
          this.$refs.seen.move(
            [-1.325, 1.733, -1.881],
            [-2.16 / 180, -0.24 / 180, -0.01 / 180]
          )
          // this.$nextTick(() => {
          //   this.$refs.seen.playAction('1', 'mmfxkg')
          // })
          this.bztext = '点击打开酶免仪前盖门'
        }
        if (i == 6.3 && this.taskstep == 5) {
          this.$refs.seen.twinklePoint(3.238, 1.35, -4.743)
          this.$refs.seen.move(
            [3.19, 1.558, -2.756],
            [-15.86 / 180, -0.47 / 180, -0.13 / 180]
          )
          this.bztext = '点击打印机，打印报告单'
        }
        if (i == 7 && this.taskstep == 5) {
          this.bztext = '点击工作站关闭按钮，关闭工作站'
        }
      },
      immediate: true,
      deep: true
    }
  },
  //方法集合
  methods: {
    erjifn(i) {
      // this.sjbox = !this.sjbox
      // if (this.sjstep == 1) {
      //   this.sjbox = true
      // } else {
      // }
      this.eritem = i
      var flag = this.taskdata[this.taskstep - 1].erdata[i - 1].sandata
      // console.log('当前点击的二级菜单名称', this.sjname)
      // 判断一下当前是不是存在三级数据
      if (flag != undefined) {
        this.sjbox = !this.sjbox
      }
    },
    audioUrlfn(i) {
      this.audioUrl = i
    },
    taskfn(i) {
      this.taskstep = i
      this.erstep = i
      this.eritem = 1
      this.erstepshow = false
      console.log('taskstep', this.taskstep)
    },
    closefn() {
      this.erstep = 0
      this.erstepshow = true
      this.sjbox = false
      // console.log('现在二级', this.erstep)
    },
    eritemfn(i) {
      // this.sjstep = 1
      // 判断当前 二级菜单下是不是有三级菜单测试
      if (this.taskdata[this.taskstep - 1].erdata[i - 1].sandata) {
        this.sjstep = 1
      }

      this.eritem = i
    },
    tg() {
      this.$nextTick(() => {
        this.taskstep = 2
        this.erstep = 2
        console.log('this0', this.taskstep)
      })
    },
    bfwc(i) {
      console.log('播放完成', i)
      // if (i == require('@/images/radio/hs1.mp3')) {
      //   this.$refs.jmcxbz.eritems = 2.5
      // }
      // if (i == require('@/images/radio/hz1.mp3')) {
      //   this.$refs.jmcxbz.eritemfn(3)
      // }
    },
    eritemfns(i) {
      // this.eritem = i
      console.log('执行了', this.$refs.mfx.eritems)
      this.$refs.mfx.eritems = i
    },
    sjstepfn(i) {
      this.sjstep = i
    },
    tipstextfn(i) {
      // console.log('触发提示')
      this.tipstext = i

      this.timer = setTimeout(() => {
        if (i == '正在进行样品离心，请稍后') {
          this.eritems = 5.1
        }
        if (i == '离心机电源已关闭') {
          this.eritem = 7
        }
        if (i == '离心后的样品无异常') {
          this.taskfn(4)
        }
        if (i == '开关无故障的提示') {
          this.sjstep = 2
        }
        if (i == '维护液充足，无需添加') {
          this.sjstep = 3
        }
        if (i == '蒸馏水充足，无需添加') {
          this.sjstep = 4
        }
        if (i == '清洗液充足，无需添加') {
          this.sjstep = 5
        }
        if (i == '乙醚充足，无需添加') {
          this.eritem = 3
        }
        if (i == '酶免仪已启动') {
          this.eritems = 3.1
        }
        if (i == '已打开') {
          this.eritem = 4
        }
        if (i == 'HBsAg稀释液充足，无需添加') {
          this.sjstep = 3
        }
        if (i == 'HBsAg酶充足，无需添加') {
          this.sjstep = 4
        }
        if (i == 'A液充足，无需添加') {
          this.sjstep = 5
        }
        if (i == 'B液充足，无需添加') {
          this.sjstep = 6
        }
        if (i == '终止液充足，无需添加') {
          this.eritem = 6
        }
        if (i == '已打印报告') {
          this.eritem = 7
        }
        if (i == '电脑已关闭') {
          this.sjstep = 3
          this.eritems = 7.2
        }
        if (i == '仪器已全部关闭') {
          this.eritem = 8
        }

        this.tipstext = ''
        clearTimeout(this.timer)
      }, 1500)
    }
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {} //如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style>
.bgys {
  background-color: #02284b;
  width: 100%;
  height: 100%;
}
</style>
